import { ref } from "vue";
import type { AvueFormOption } from "@smallwei/avue";

export default function () {
  const option: AvueFormOption = {
    menuBtn: false,
    labelWidth: 110,
    column: [
      {
        prop: "roleName",
        label: "角色名称",
        search: true,
        span: 24,
        rules: [
          {
            required: true,
            message: "请输入角色名称",
          },
        ],
      },
      {
        prop: "roleKey",
        label: "权限字符",
        search: true,
        span: 24,
        rules: [
          {
            required: true,
            message: "请输入权限字符",
          },
        ],
      },
      {
        type: "number",
        prop: "roleSort",
        label: "显示顺序",
        span: 12,
        rules: [
          {
            required: true,
            message: "请输入显示顺序",
          },
        ],
      },
      {
        type: "select",
        prop: "status",
        label: "状态",
        span: 12,
        dicUrl: "/api/system/dict/type/optionSelect/sys_status",
        props: {
          label: "dictLabel",
          value: "dictValue",
        },
      },
      {
        type: "tree",
        prop: "menuIds",
        label: "菜单权限",
        span: 24,
        multiple: true,
        dicUrl: "/api/system/menu/treeSelect",
        props: {
          label: "menuName",
          value: "id",
        },
        tags: true,
      },
      {
        prop: "remark",
        label: "备注",
        span: 24,
      },
    ],
  };
  return ref(option);
}
